cc.Class({
	extends: cc.Component,

	properties: {
		content: cc.Node,
		NickName: cc.Label,
		goldCount: cc.Label,
	},

	// onLoad () {},

	start() {
		this.createDesk();
/* 
		cc.log(this.goldCount.string)
		cc.log(this.NickName.string)
*/
		this.refreshPlayerInfo()
	},
	createDesk() {
		for (let i = 0; i < 24; i++) {
			let desk = cc.instantiate(cc.vv.warehouse.prefab.desk);
			desk.getComponent("Desk").init(i + 1);
			this.content.addChild(desk);
		}
	},
	// 刷新个人信息
	refreshPlayerInfo() {
		this.NickName.string = String(cc.vv.PlayerInfo.accountID);
		this.goldCount.string = String(cc.vv.PlayerInfo.gold);
		cc.log(this.goldCount.string)
		cc.log(this.NickName.string)
	},
	// update (dt) {},
});
